



/**
 * User domain class.
 */
class User {
	static transients = ['pass']
	static hasMany = [authorities: Role]
	static belongsTo = Role

	/** Username */
	String username = ''
    String realname = ''
    String sex = ''
    String personId = '' //身份证
    Date birthday
    String area = ''
    String tel = ''
    String mobile = ''
    String qq = ''
    String email = ''
    String address = ''
    String post = ''
    String introduction = '' // 自我介绍
    Date createTime = new Date()
    boolean isFind = false //是否已经找到合适的老师或者学生了
 
	/** MD5 Password */
	String passwd = '123456'
	/** enabled */
	boolean enabled = true
 
	/** plain password to create a MD5 password */
	String pass = '[secret]'


	static constraints = {
		username(blank: false,size: 1..100, unique: true)
		realname(blank: true,size: 1..100)
 		passwd(blank: false,nullable:true)
 		sex(blank: true)
 		personId(blank: true,nullable:true)
 		area(blank: true)
 		tel(blank: true,nullable:true)
 		mobile(blank: true)
 		qq(blank: true,nullable:true)
 		email(blank: true,nullable:true)
 		address(blank: true,nullable:true)
 		post(blank: true,nullable:true)
 		introduction(size: 1..1000,blank: true,nullable:true)
		enabled()
        isFind()
	}

    static mapping = {
        tablePerHierarchy false
  
        //authorities sort : 'id' , order : 'asc' 
    }

}
